import request from '@/utils/request'

// 查询用户列表
export function listUser(query) {
  return request({
    url: '/user/user/list',
    method: 'get',
    params: query
  })
}

// 查询用户详细
export function getUser(id) {
  return request({
    url: '/user/user/' + id,
    method: 'get'
  })
}

// 新增用户
export function addUser(data) {
  return request({
    url: '/user/user/add',
    method: 'post',
    data: data
  })
}

// 修改用户
export function updateUser(data) {
  return request({
    url: '/user/user/edit',
    method: 'put',
    data: data
  })
}

// 注销用户,只传id
export function cancelUser(data) {
  return request({
    url: '/user/user/cancelUser',
    method: 'put',
    data: data
  })
}

// 用户绑定卡片
export function bindCord(data) {
  return request({
    url: '/user/user/bindCord',
    method: 'put',
    data: data
  })
}

// 删除用户
export function delUser(id) {
  return request({
    url: '/user/user/remove/' + id,
    method: 'delete'
  })
}

// 导出用户
export function exportUser(query) {
  return request({
    url: '/user/user/export',
    method: 'get',
    params: query
  })
}

// 下载导入模板
export function downloadTemplate(query) {
  return request({
    url: '/user/user/downloadTemplate',
    method: 'get',
    params: query
  })
}

//导入用户
export function importTemplate(data) {
  return request({
    url: '/user/user/importTemplate',
    method: 'post',
    data: data
  })
}

// 下载失败数据
export function downloadFailTemplate(id) {
  return request({
    url: '/user/user/downloadTemplate/' + id,
    method: 'get'
  })
}

// 获取充值金额配置
export function getActivityConfig(id) {
  return request({
    url: '/user/user/getActivityConfig/' + id,
    method: 'get'
  })
}

// 管理员充值生成二维码
export function getQRCode(data) {
  return request({
    url: '/user/user/getQRCode',
    method: 'post',
    data: data
  })
}
// 下载导入模板
export function exportMakeCard(query) {
  return request({
    url: '/user/user/exportMakeCard',
    method: 'get',
    params: query
  })
}
